import os
import sys
import django

base_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
sys.path.append(base_dir)

os.environ.setdefault("DJANGO_SETTINGS_MODULE","demos.settings")
django.setup()

from api import models

################形成评论数据#####################
first1 =  models.CommentRecord.objects.create(
    news_id=36,
    content="第1条一级评论",
    user_id=1,
    depth=1
)


first1_1 = models.CommentRecord.objects.create(
    news_id=36,
    content="第1条的二级评论第一条",
    user_id=6,
    depth=2,
    reply=first1,
    root=first1
)

first1_2 = models.CommentRecord.objects.create(
    news_id=36,
    content="第一条的二级评论的第二条",
    user_id=8,
    reply=first1,
    depth=2,
    root=first1
)


first1_1_1 = models.CommentRecord.objects.create(
    news_id=36,
    content="第1条的三级级评论第一条",
    user_id=10,
    depth=3,
    reply=first1_1,
    root=first1
)

first1_1_2 = models.CommentRecord.objects.create(
    news_id=36,
    content="第1条的三级级评论第二条",
    user_id=14,
    depth=3,
    reply=first1_1,
    root=first1
)





first2 =  models.CommentRecord.objects.create(
    news_id=36,
    content="第2条一级评论",
    user_id=3,
    depth=1
)


first3 =  models.CommentRecord.objects.create(
    news_id=36,
    content="第3条一级评论",
    user_id=4,
    depth=1
)

